package com.dyc.caradvertisting.ui.fmt.bind.bs.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.dyc.caradvertisting.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by niejiahuan on 16/11/22.
 */

public class CarNumberAdpater extends BaseAdapter {
    private List<String> mCarNumber;
    private Context mContext;
    public LayoutInflater mLayoutInflater;

    public CarNumberAdpater(List<String> carNumber, Context context) {
        mCarNumber = carNumber;
        mContext = context;
        mLayoutInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return mCarNumber.size();
    }

    @Override
    public Object getItem(int i) {
        return mCarNumber.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (null == view) {
            view = mLayoutInflater.inflate(R.layout.itme_car_number, null);
        }
        ((TextView)view.findViewById(R.id.tv_car_number)).setText(mCarNumber.get(i));
        return view;
    }
}
